package edu.suda.xsap.service.impl;
import edu.suda.xsap.dto.Statistics_courseconsumeDto;
import edu.suda.xsap.dto.convert.Statistics_courseconsumeConvert;
import edu.suda.xsap.entity.Statistics_charge;
import edu.suda.xsap.entity.Statistics_courseconsume;
import edu.suda.xsap.mapper.Statistics_courseconsumeMapper;
import edu.suda.xsap.service.Statistics_courseconsumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.Year;
import java.util.List;

@Service
public class Statistics_courseconsumeServiceImpl implements Statistics_courseconsumeService {

    @Autowired
    private Statistics_courseconsumeConvert statistics_courseconsumeConvert;

    @Autowired
    private Statistics_courseconsumeMapper statistics_courseconsumeMapper;

    @Override
    public List<Statistics_courseconsumeDto> findYEAR(Year year1, Year year2) {
        //
        List<Statistics_courseconsume> statistics_courseconsumes = statistics_courseconsumeMapper.findYEAR(year1,year2);
        //要把这个List<s_c>转换成List<s_cDto>
        return statistics_courseconsumeConvert.toDtoList(statistics_courseconsumes);
    }

    @Override
    public List<Statistics_courseconsumeDto> findMONTH(Year year) {
        //
        List<Statistics_courseconsume> statistics_courseconsumes = statistics_courseconsumeMapper.findMONTH(year);
        //要把这个List<s_c>转换成List<s_cDto>
        return statistics_courseconsumeConvert.toDtoList(statistics_courseconsumes);
    }

}
